package com.honghu.paylibrary.enums;


import androidx.annotation.DrawableRes;
import androidx.annotation.StringRes;

import com.honghu.paylibrary.R;
import com.zhouyou.http.EasyHttp;

//余额 支付宝支付 微信支付 银行卡支付 银联快捷支付
public enum PayType {
//    PAY(0, "余额"),ALIPAY_PAY(2, "支付宝支付"), WE_CHAT_PAY(3, "微信支付"),
//    BANK_CARD_PAY(1, "银行卡支付"),YL_PAY(4, "银联快捷支付"), ;

    LIPAY_PAY(1, R.drawable.pl_ic_alipay,R.string.string_alipay_desc), WE_CHAT_PAY(2, R.drawable.pl_ic_weixin,R.string.string_wei_xin_desc),
    YL_PAY(0, R.drawable.pl_ic_yinlian,R.string.string_yinlian_desc), ;


    private int value;
    private @DrawableRes
    int src;
    private @StringRes
    int descId;
    private String id;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }


    PayType(int value, @DrawableRes int src, @StringRes int descId) {
        this.value = value;
        this.descId = descId;
        this.src = src;
    }
    public static PayType enumOfValue(int value) {
        for (PayType direction : values()) {
            if (direction.getValue() == value) {
                return direction;
            }
        }
        return YL_PAY;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }


    public String getDesc() {
        return EasyHttp.getContext().getString(descId);
    }

    public int getSrc() {
        return src;
    }
}
